package org.zjx.entity;

import lombok.Data;
import org.zjx.dom4j.XmlField;

@Data
public class Coordinate {
    @XmlField
    private Integer x;
    @XmlField
    private Integer y;

    public Coordinate() {}

    public Coordinate(int x, int y) {
        if (x < 0 || y < 0) {
            throw new IllegalArgumentException("坐标值不能为负数，传入的 x: " + x + ", y: " + y);
        }
        this.x = x;
        this.y = y;
    }
}
